<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>homework2</title>
</head>
<body>
<pre>

作业1
import math
s = input();
e_count=0
m_count=0
for ch in s :
    if ch>='a' and ch <='z':
        e_count=e_count+1
    elif ch>='A' and ch <= 'Z':
        e_count=e_count+1
    elif ch>='0' and ch<='9':
         m_count=m_count+1
print("英文字母有{}个".format(e_count))
print("数字有{}个".format(m_count))

作业2
str1 = input()
str2 = input()

def is_same(str1, str2):
    list1 = list(str1)
    list1.sort()
    list2 = list(str2)
    list2.sort()
    return list1 == list2

print(is_same(str1, str2))

作业3
x = 0
y = 0
flag = True
while flag:
    string = input()
    list1 = string.split(" ")
    if list1[0] == 'STOP':
        i = math.sqrt(x * x + y * y)
        j = int(i)
        if i - j >= 0.5:
            k = int(i + 1)
            print("到原点距离为{}".format(k))
            break
        else:
            print("到原点距离为{}".format(j))
            break

    elif list1[0] == 'RIGHT':
        x = x + int(list1[1])
    elif list1[0] == 'LEFT':
        x = x - int(list1[1])
    elif list1[0] == 'UP':
        y = y + int(list1[1])
    elif list1[0] == 'DOWN':
        y = y - int(list1[1])
</pre>
</body>
</html>